<template>
  <div>
    <!-- 项目详情介绍 -->
    <div class="project_item_box projectInfo_item_box flexLeft posR marB40">
      <img src="@/assets/images/index/item1.png" class="project_img" />
      <div class="project_text_box flexBet flexColumn marL30">
        <h3 class="project_name fontS26 fonBold">{{ data.prizeTypeName }}</h3>
        <div>
          <div class="marB20 fontS20 color7F">
            开始时间:
            <span class="color3 marL20">{{ data.startTime }}</span>
          </div>
          <div class="fontS20 marB20 color7F">
            结束时间: <span class="marL20 color3">{{ data.overTime }}</span>
          </div>
          <div class="fontS20 color7F flexLeft accessory">
            <span class="accessoryText">附件:</span>
            <div
              class="flexColumn"
              v-if="data.fileList && data.fileList.length > 0"
            >
              <div
                class="marL20 marB20 color3 accessoryFile flexBet"
                v-for="(i, k) in data.fileList"
                :key="k"
              >
                <div class="fontS20 color53 danhang">{{i.fileName}}</div>
                <div class="flexLeft" @click="donwnloadF(i.url)">
                  <img
                    src="@/assets/images/index/download.png"
                    class="download"
                  />
                  <div class="color35 fontS18">下载</div>
                </div>
              </div>
            </div>
            <div v-else class="fontS20 color53 marL25">暂无附件</div>
          </div>
        </div>
        <!-- data.prizeTypeId -->

        <!-- <div
          class="declare_btn fontS30 wColor"
          @click="goBroadcastPage"
          >高清播出</div
        > -->
        <router-link
          class="declare_btn fontS30 wColor"
          :to="{
            path: '/index/declareDetails',
            query: { id: data.prizeTypeId },
          }"
          v-if="data.type == 1"
          >立即申报</router-link
        >
        <div
          v-else
          style="
            width: 600px;
            display: flex;
            justify-content: space-around;
            align-content: center;
          "
        >
          <a-dropdown>
            <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
              <div class="declare_btn fontS30 wColor">金鹿奖申报</div>
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a href="javascript:;" @click="goReportPage(1)" class="color35"
                  >录制技术奖 ></a
                >
              </a-menu-item>
              <a-menu-item>
                <a
                  href="javascript:;"
                  @click="goBroadcastPage(1)"
                  class="color35"
                  >播出技术奖 ></a
                >
              </a-menu-item>
            </a-menu>
          </a-dropdown>

          <a-dropdown style="margin-left: 24upx">
            <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
              <div class="declare_btn fontS30 wColor">金帆奖申报</div>
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a href="javascript:;" @click="goReportPage(2)" class="color35"
                  >录制技术奖 ></a
                >
              </a-menu-item>
              <a-menu-item>
                <a
                  href="javascript:;"
                  @click="goBroadcastPage(2)"
                  class="color35"
                  >播出技术奖 ></a
                >
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </div>
      </div>
      <!-- bg -->
      <div class="projectInfo_bg posA"></div>
    </div>
    <!-- 项目概述 -->
    <div class="maxWidth projectOutline marT14">
      <div class="projectText marL25 posR fontS22 marB30">项目概述</div>
      <p class="fontS18" v-html="data.prizeTypeDetail"></p>
    </div>
  </div>
</template>

<script>
import baseUrl from "@/api/servers/baseUrl.js";
import { prizetypeInfo } from "@/api";
export default {
  data() {
    return {
      data: {},
    };
  },
  filters: {
    setProjectStatus(e) {
      return e == 0 ? "未开始" : e == 1 ? "申报中" : "已结束";
    },
  },
  async created() {
    const res = await prizetypeInfo({
      prizeTypeId:this.$route.query.id,
      typeId:""
    });
    if (res.code != 200) return this.$message.error(res.msg);
    this.data = res.data;
  },
  methods: {
    goReportPage(e) {
      if (e === 1) {
        this.$router.push({
          path: "/index/jlhighVideoBroadcast",
          query: {
            type: 1, // 1  2
            prizeTypeId: this.data.prizeTypeId,
          },
        });
      } else {
        this.$router.push({
          path: "/index/highVideoReport",
          query: {
            type: 1, // 1  2
            prizeTypeId: this.data.prizeTypeId,
          },
        });
      }
    },
    donwnloadF(e){
      // console.log(e)
      // console.log(baseUrl.BASEURL)
      window.location.href = e
    },
    goBroadcastPage(e) {
      // return
      if (e === 2) {
        this.$router.push({
          path: "/index/highVideoBroadcast",
          // path: "/index/jlhighVideoReport",
          query: {
            type: 1, // 1  2
            prizeTypeId: this.data.prizeTypeId,
          },
        });
      } else {
        this.$router.push({
          path: "/index/jlhighVideoReport",
          query: {
            type: 1, // 1  2
            prizeTypeId: this.data.prizeTypeId,
          },
        });
      }
    },
  },
};
</script>

<style>
body {
  background-color: #f0f2f6 !important;
}
.color53 {
  color: #537fa7 !important;
}
.color35 {
  color: #3586fe !important;
}
.danhang{
  width: 400px;
              overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
}
</style>